package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * 客户服务表
 */
@Entity
@Table(name = "server", schema = "springboot", catalog = "")
public class Server {
    private int servId;             //客户服务id
    private String servSubject;     //主题
    private String servType;        //类型
    private String servMode;        //方式
    private Timestamp servDate;     //开始时间
    private String servOper;        //执行人
    private String servData;        //花费时间
    private BigInteger servState;   //状态
    private String servDetails;     //内容
    private String servTicks;       //反馈
    private String servRemark;      //备注
    private Integer servDelete;     //逻辑删除
    private Customer customerByCustomId;

    public Server() {

    }

    @Id
    @Column(name = "serv_id")
    public int getServId() {
        return servId;
    }

    public void setServId(int servId) {
        this.servId = servId;
    }

    @Basic
    @Column(name = "serv_subject")
    public String getServSubject() {
        return servSubject;
    }

    public void setServSubject(String servSubject) {
        this.servSubject = servSubject;
    }

    @Basic
    @Column(name = "serv_type")
    public String getServType() {
        return servType;
    }

    public void setServType(String servType) {
        this.servType = servType;
    }

    @Basic
    @Column(name = "serv_mode")
    public String getServMode() {
        return servMode;
    }

    public void setServMode(String servMode) {
        this.servMode = servMode;
    }

    @Basic
    @Column(name = "serv_date")
    public Timestamp getServDate() {
        return servDate;
    }

    public void setServDate(Timestamp servDate) {
        this.servDate = servDate;
    }

    @Basic
    @Column(name = "serv_oper")
    public String getServOper() {
        return servOper;
    }

    public void setServOper(String servOper) {
        this.servOper = servOper;
    }

    @Basic
    @Column(name = "serv_data")
    public String getServData() {
        return servData;
    }

    public void setServData(String servData) {
        this.servData = servData;
    }

    @Basic
    @Column(name = "serv_state")
    public BigInteger getServState() {
        return servState;
    }

    public void setServState(BigInteger servState) {
        this.servState = servState;
    }

    @Basic
    @Column(name = "serv_details")
    public String getServDetails() {
        return servDetails;
    }

    public void setServDetails(String servDetails) {
        this.servDetails = servDetails;
    }

    @Basic
    @Column(name = "serv_ticks")
    public String getServTicks() {
        return servTicks;
    }

    public void setServTicks(String servTicks) {
        this.servTicks = servTicks;
    }

    @Basic
    @Column(name = "serv_remark")
    public String getServRemark() {
        return servRemark;
    }

    public void setServRemark(String servRemark) {
        this.servRemark = servRemark;
    }

    @Basic
    @Column(name = "serv_delete")
    public Integer getServDelete() {
        return servDelete;
    }

    public void setServDelete(Integer servDelete) {
        this.servDelete = servDelete;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Server server = (Server) o;
        return servId == server.servId &&
                Objects.equals(servSubject, server.servSubject) &&
                Objects.equals(servType, server.servType) &&
                Objects.equals(servMode, server.servMode) &&
                Objects.equals(servDate, server.servDate) &&
                Objects.equals(servOper, server.servOper) &&
                Objects.equals(servData, server.servData) &&
                Objects.equals(servState, server.servState) &&
                Objects.equals(servDetails, server.servDetails) &&
                Objects.equals(servTicks, server.servTicks) &&
                Objects.equals(servRemark, server.servRemark);
    }

    @Override
    public int hashCode() {
        return Objects.hash(servId, servSubject, servType, servMode, servDate, servOper, servData, servState, servDetails, servTicks, servRemark);
    }

    @ManyToOne
    @JoinColumn(name = "custom_id", referencedColumnName = "custom_id")
    public Customer getCustomerByCustomId() {
        return customerByCustomId;
    }

    public void setCustomerByCustomId(Customer customerByCustomId) {
        this.customerByCustomId = customerByCustomId;
    }
}
